package com.example.productdataserviceprovider.service.city;


import com.example.productdataserviceprovider.service.AbstractService;

import java.util.Map;
import java.util.concurrent.CountDownLatch;
@Deprecated
public class CityThread extends AbstractService implements Runnable{
    private CountDownLatch latch;
    private CityService service;
    private Map<String,String> citys;
    private String keyWords;
    private String resultFile;
    public CityThread(CityService service, Map<String,String> citys, String keyWords, String resultFile, CountDownLatch latch){
        this.service=service;
        this.citys=citys;
        this.keyWords=keyWords;
        this.resultFile=resultFile;
        this.latch=latch;
    }
    public void run(){
        String[] keys=keyWords.split(",");
        for(String key:keys) {
            service.analysisCitys(citys, key, resultFile);
        }

        latch.countDown();
        logger.info(Thread.currentThread().getName()+"======latch==="+latch.getCount());
    }

}
